/* 
 * File:   RepositorioBuilderTest.cpp
 * Author: max
 *
 * Created on Jun 9, 2013, 5:18:34 PM
 */

#include <stdlib.h>
#include <iostream>
#include "common_RepositorioBuilder.h"
#include "common_Repositorio.h"

using namespace TP::Archivos;
/*
 * Simple C++ Test Suite
 */

void test1() {
    std::cout << "RepositorioBuilderTest test 1" << std::endl;
    RepositorioBuilder builder;
    
    Repositorio* repositorio = builder.ConstruirDeRutaDirectorio("/home/Max/test");

    if (repositorio->GetVersion() != 1)
    {
        std::cout << "%TEST_FAILED% time=0 testname=test1 (RepositorioBuilderTest) message=La version de repositorio no es la esperada." << std::endl;
    }
    
    /* NO COMPILA
    
    if (repositorio->GetRepoItemByFilename("test_3.txt")->GetHash(0) != "d8d4c2d1c8e4b04d96bca23175d071c5")
    {
        std::cout << "%TEST_FAILED% time=0 testname=test1 (RepositorioBuilderTest) message=El hash computado 0 en la posicion no es el esperado." << std::endl;
    }

    if (repositorio->GetRepoItemByFilename("test_3.txt")->GetHash(3) != "9985c204968c40c2f0f2f22b262301ff")
    {
        std::cout << "%TEST_FAILED% time=0 testname=test1 (RepositorioBuilderTest) message=El hash computado en la posicion 3 no es el esperado." << std::endl;
    }
    
    */
}

int main(int argc, char** argv) {
    std::cout << "%SUITE_STARTING% RepositorioBuilderTest" << std::endl;
    std::cout << "%SUITE_STARTED%" << std::endl;

    std::cout << "%TEST_STARTED% test1 (RepositorioBuilderTest)" << std::endl;
    test1();
    std::cout << "%TEST_FINISHED% time=0 test1 (RepositorioBuilderTest)" << std::endl;

    std::cout << "%SUITE_FINISHED% time=0" << std::endl;

    return (EXIT_SUCCESS);
}

